def sum_A(a,n):
    result,t = 0,0
    for i in range(n):
        t = t * 10 + a
        result += t
    return result
a = int(input('输入整数a的值:'))
n = int(input('输入整数n的值:'))
print(sum_A(a, n))